<?php

namespace app\api\controller;

use app\api\model\Message as MessageModel;
use app\common\model\Joins as JoinsModel;

class Test extends Controller
{
    /**
     * @throws \app\common\exception\BaseException
     * @throws \think\Exception
     * @throws \think\exception\DbException
     */
    public function index(){


        $a = '1.234';
        $b = '5';

        echo "作差之后输出后面带两个参数：".bcsub($a, $b)."\n\r";
        echo "作差之后输出后面带三个参数：".bcsub($a, $b, 4)."\n\r";


        echo "加和之后输出后面带两个参数：". bcadd($a, $b)."\n\r";     // 6
        echo "加和之后输出后面带三个参数：".bcadd($a, $b, 4)."\n\r";  // 6.2340
        exit();
        // 获取当前小程序信息
        //$wxConfig = Wxapp::getWxappCache();
        $model = JoinsModel::get(['wechat_order_num'=>'2022080854565651']);
       $wxConfig = ['app_id'=>'wxe01c8b9b01cab98f','app_secret'=>'6189a2f58a04dc0893b2dda363913d04'];
        $mssage = new \app\api\model\Message($wxConfig['app_id'], $wxConfig['app_secret']);
        $data = [
            'first'=>'有新加盟商申请，请及时确认',
            'keyword1' =>$model->name,
            'keyword2'=>$model->phone,
            'keyword3'=>$model->pay_time,
            'keyword4'=>$model->Brand,
            'remark'=>$model->address,
        ];
        $result = $mssage->sendMessage($data);
        var_dump($result);exit();
    }
}